package gateway

import "cloud-export-iotkit-mqtt/pkg/iita"

// 网关接口
type IGateway interface {
	// Initialize 初始化
	Initialize(otherConfig ...interface{}) error

	// AddSubDevice 添加子设备
	AddSubDevice(device iita.Device) error
	// RemoveSubDevice 移除子设备
	RemoveSubDevice(device iita.Device) error

	// GetSubDeviceById 获取子设备
	GetSubDeviceById(deviceName string) (iita.Device, bool)

	// 获取所有的子设备
	GetDeviceMap() map[string]iita.Device

	// RegisterSelf 注册自己
	RegisterSelf() error

	// RegisterDevice 注册子设备
	RegisterDevice(device iita.Device) error

	// DeRegisterDeviceByName 取消注册
	DeRegisterDeviceByName(deviceName string) error

	// Run 运行
	Run(args ...interface{})

	// Stop 停止
	Stop() error
}
